package com.xiyang.operater;

import com.xiyang.operater.entity.User;
import com.xiyang.operater.service.UserService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;


//@EnableDiscoveryClient
//@EnableFeignClients
//@EnableHystrix //断路器
//@EnableHystrixDashboard //断路器仪表板
@SpringBootApplication
public class OperatorApplication {

    public static ApplicationContext ctx=null;

    public static void main(String[] args) {
         SpringApplication.run(OperatorApplication.class, args);

      /*  SpringApplication app=new SpringApplication(OperatorApplication.class);
        ctx=app.run(args);
		UserService userService = (UserService)ctx.getBean("userService");
        User user= userService.findUserByUsername("ls");
        BCryptPasswordEncoder bc=new BCryptPasswordEncoder(4);//将密码加密 可以先设置初始密码：000000
        user.setPassword(bc.encode(user.getPassword()));//然后使用密码为key值进行加密，运行主类后，会自动加密密码，可连接数据库查看。
        System.out.println("密码"+user.getPassword());
        userService.saveAndFlush(user);//运行一次后记得注释这段重复加密会无法匹配*/
    }

}
